<template>
  <div>
    <div class="box">
      <img src="../../../assets/img/维系登录(1).png" alt />
      <div class="inp1">
        手机号
        <input type="text" v-model="user.phone" />
      </div>
      <div class="inp2">
        昵称
        <input type="text" v-model="user.nickname" />
      </div>
      <div class="inp2">
        密码
        <input type="text" v-model="user.password" />
      </div>
      <div>
        <button class="denglu" @click="register">注册</button>
      </div>
    </div>
  </div>
</template>

<script>
import {reqRegister} from "../../../http/api"
export default {
  data() {
    return {
      user: {
        phone: "",
        nickname: "",
        password: ""
      }
    };
  },
  methods: {
    register() {
      reqRegister(this.user).then(res=>{
        if(res.data.code==200){
          this.$router.push("/login")
        }
      })
    }
  }
};
</script>

<style scoped>
html,
body {
  width: 100%;
  height: 100%;
  background-color: #f2f2f2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.box {
  width: 90%;
  height: 95%;
  background-color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 0.24rem;
  margin: 3rem auto 0;
}
.box img {
  width: 3.63rem;
  height: 0.96rem;
  margin-bottom: 0.6rem;
}
.box .inp1,
.box .inp2 {
  width: 6.1rem;
  height: 0.7rem;
  padding: 0.1rem 0;
  border-bottom: 1px solid gainsboro;
  color: gray;
}
.box .inp1 input,
.box .inp2 input {
  width: 2.5rem;
  padding-left: 0.2rem;
}
.box .inp2 {
  display: flex;
  align-items: center;
  margin-bottom: 0.4rem;
}
.box .inp2 input:nth-of-type(2) {
  background-color: #cccccc;
  color: white;
  padding: 0.1rem;
}
.box .denglu {
  width: 6.1rem;
  height: 1rem;
  font-size: 0.3rem;
  font-weight: bolder;
  color: white;
  background-color: #cccccc;
}
</style>